package router

import (
	"longmen/server/internal/api"

	"github.com/labstack/echo/v4"
)

func initUserRoute(group *echo.Group, base api.Controller, authFunc echo.MiddlewareFunc) {
	group.POST("/user/regist", base.Regist)
	group.POST("/user/file", base.Upload)
	group.POST("/user/sendVerifyCode", base.SendVerifyCode, authFunc)
	group.POST("/user/sendCode", base.SendCode)
	group.POST("/user/register", base.ExecRegister)
	group.POST("/user/login", base.Login)
	group.POST("/user/fastLogin", base.FastLogin)
	group.POST("/user/readyForTakeOff", base.ReadyForTakeOff)
	group.GET("/user/logout", base.Logout, authFunc)
	group.POST("/user/deactive", base.Deactive, authFunc)
	group.POST("/user/logout", base.Logout, authFunc)
	group.POST("/user/editUserInfo", base.EditUserInfo, authFunc)
	group.POST("/user/updateNickName", base.UpdateNickName, authFunc)
	group.POST("/user/changeMobile", base.ChangeMobile, authFunc)
	group.POST("/user/checkSmsCode", base.CheckSmsCode, authFunc)
	group.POST("/user/changePayPwd", base.ChangePayPwd, authFunc)
	group.POST("/user/getUserInfo", base.GetUserInfo, authFunc)
	group.POST("/user/forgetPwd", base.ForgetPwd)
	group.POST("/user/forgetPwdHash", base.ForgetPwdHash)
	group.POST("/user/changePwd", base.ChangePwd, authFunc)
	group.POST("/user/addBank", base.AddBank, authFunc)
	group.POST("/user/getBanks", base.GetBanks, authFunc)
	group.POST("/user/delBank/:id", base.DelBank, authFunc)
	group.POST("/user/getFans", base.GetFans, authFunc)                     //粉丝列表
	group.POST("/user/saveAddress", base.SaveAddress, authFunc)             //新建/编辑地址
	group.POST("/user/getAddress", base.GetAddress, authFunc)               //获取地址
	group.POST("/user/defaultAvatar", base.GetDefultAvatars)                //默认头像
	group.POST("/user/getUserAsset", base.GetUserAsset, authFunc)           //用户余额 提现概览
	group.POST("/user/checkAnchorStatus", base.CheckAnchorStatus, authFunc) //开播状态检查
	//groupUser.POST("/user/userBackpack", base.UserBackpack, authFunc)           //用户背包
	group.POST("/user/getInviteInfo", base.GetInviteInfo, authFunc)       //获取邀请数据
	group.POST("/user/receiveReward", base.ReceiveReward, authFunc)       //领取拉新奖励
	group.POST("/user/checkBindAccount", base.CheckBindAccount, authFunc) //检查绑定6T账号状态
	group.POST("/user/bindAccount", base.BindAccount, authFunc)           //绑定6T账号
	group.POST("/user/unbindAccount", base.UnbindAccount, authFunc)       //解绑6T账号

	//主播
	group.POST("/anchor/attentAnchor", base.AttentAnchor, authFunc)         //关注、取消关注主播
	group.POST("/anchor/attentAnchors", base.AttentAnchors, authFunc)       //批量关注主播
	group.POST("/anchor/getAnchorInfo", base.GetAnchorInfo)                 //主播详情
	group.POST("/anchor/checkAttent", base.CheckAttent, authFunc)           //检测是否已关注
	group.POST("/anchor/getAnchorBasicInfo", base.GetAnchorBasicInfo)       //主播基础信息
	group.POST("/anchor/addVisitorLog", base.AddVisitorLog)                 //写入访客记录
	group.POST("/anchor/getAttentAnchors", base.GetAttentAnchors, authFunc) //关注主播列表
	group.POST("/anchor/checkAnchorExist", base.CheckAnchorExist)           //主播是否存在

	//auth
	group.POST("/auth/identityAuth", base.IdentityAuth, authFunc) // 申请成为主播
	group.POST("/auth/sendBindCode", base.SendBindCode)
	group.POST("/auth/getAuthInfo", base.GetAuthInfo, authFunc)

	//rank
	group.POST("/rank/getAnchorRankList", base.GetAnchorRankList) //主播排行榜
	group.POST("/rank/getUserRankList", base.GetUserRankList)     //用户排行榜

	//intimacy 亲密度
	group.POST("/intimacy/getTotalIntimacyRank", base.GetTotalIntimacyRank)
	group.POST("/intimacy/getWeekIntimacyRank", base.GetWeekIntimacyRank)

	// 简化注册 密码注册
	group.POST("/user/simple_regist", base.SimpleRegist)
}
